<?php echo $this -> Html -> css('Base/index'); ?>

<!-- BEGIN PAGE CONTENT-->
<div class="box">
	<div class="box-header">
		<h3 class="box-title">Products List</h3>
	</div><!-- /.box-header -->

	<!-- Button Add Product -->
	<div class="btn-add-element">
		<?php echo $this -> Html -> link('Add', array('controller' => 'products', 'action' => 'add'), array('class' => 'btn btn-primary btn-flat')); ?>
	</div>
	<!--thong bao-->
	<?php echo $this->Session->flash();?>
	<!--/thong bao-->
	<div class="box-body table-responsive">
		<!-- BEGIN TABLE PRODUCTS LIST-->
		<table id="example1" class="table table-bordered table-striped">
			<thead>
				<tr>
					<th>Tên</th>
					<th>Os</th>
					<th>Hình</th>
					<th>Hình</th>
					<th>Youtube</th>
					<th>Edit</th>
				</tr>
			</thead>
			<tbody>
				    <?php foreach($data as $item){?>
						<tr>
							<td><?php echo $item['Product']['name'];?></td>
							<td><?php echo $item['Os']['name']; ?></td>
							<td><?php echo $item['Product']['img1'];?></td>
							<td><?php echo $item['Product']['img2'];?></td>
							<td><?php echo $item['Product']['youtubeId'];?></td>
							<td> 
								<a href="/admin/products/edit/<?php echo $item['Product']['id'] ?>"><i class="fa fa-edit"></i></a>
								<a href="/admin/products/delete/<?php echo $item['Product']['id'] ?>" onclick="if (confirm('Bạn có muốn xóa sản phẩm ?')) { return true; } return false;"><i class="fa  fa-times-circle"></i></a>
							</td>
						</tr>
					<?php }?>
			</tbody>
		</table>
		<!-- END TABLE PRODUCTS LIST-->
	</div><!-- /.box-body -->
	 <!-- BEGIN PAGINATION -->
    <?php echo $this->element('pagination', array('Paginator' => $this->Paginator));?>
 <!-- END PAGINATION -->
</div><!-- /.box -->
<!-- END PAGE CONTENT -->

<!-- page script -->
<script type="text/javascript">
	$(function() {
		$('#example1').dataTable({
                    "bPaginate": false,
                    "bLengthChange": false,
                    "bFilter": true,
                    "bSort": true,
                    "bInfo": false,
                    "bAutoWidth": false
         });
	}); 
</script>